/* 
 * Copyright 2014 Josef Hertl.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package caetus.pkcs11.session;

/**
 *
 * @author Josef Hertl
 */
public class OutputMessage {

    /**
     * Whether the function used a secret key (true) or private/public key pair
     * (false)
     */
    private boolean symmetric;
    private String functionName;
    private boolean success;
    /**
     * If the function fails, this marks how severe the failure was.
     */
    private int severity;
    private String comment;

    /**
     *
     * @param symmetric True for symmetric key, false otherwise.
     * @param functionName The name of the tested function.
     * @param success True if success, false otherwise.
     * @param comment Why the function failed.
     */
    public OutputMessage(boolean symmetric, String functionName, boolean success, int severity, String comment) {
        this.symmetric = symmetric;
        this.functionName = functionName;
        this.success = success;
        this.severity = severity;
        this.comment = comment;
    }

    public boolean isSymmetric() {
        return symmetric;
    }

    public String getFunctionName() {
        return functionName;
    }

    public boolean isSuccess() {
        return success;
    }

    public int getSeverity() {
        return severity;
    }

    public String getComment() {
        return comment;
    }
}
